$("#templateBox").on('click','.oneClass',function () {
    $(this).children('.glyphicon-plus-sign').toggle();
    $(this).children('.glyphicon-minus-sign').toggle();
    $(this).children('ul').toggle();
});
$("#templateBox").on('click','.twoClass span:last-of-type',function (e) {
    e.stopPropagation();
    $("span").removeClass('templateStyle');
    $(this).addClass('templateStyle');
});
templatePreservation = function () {
    var id = $(".templateStyle").attr('id');
    var text = $(".templateStyle").html();
    var texts = $(".templateStyle").parent().parent().prev().html();
    window.parent.document.getElementById("idValue").value = id;
    window.parent.document.getElementById("templateCategory").innerHTML = texts + " > " + text;
    $("#Choice",parent.document).hide();
    parent.layer.close(parent.layer.getFrameIndex(window.name))
}